#include <stdio.h>
int month[13]={0,31,28,31,30,31,30,31,31,30,31,30,31};
bool isleap(int year){
    if((year%4==0&&year%100!=0)||year%400==0)
        return true;
    else
        return false;
}
int main (){
    int time1,time2;
    int year1,year2,month1,month2,day1,day2;
    scanf("%d%d",&time1,&time2);
    if(time1>time2){
        int temp;
        temp = time1;
        time1 = time2;
        time2 = temp;
    }
    year1 = time1/10000;
    month1 = time1%10000/100;
    day1 = time1%100;
    year2 = time2/10000;
    month2 = time2%10000/100;
    day2 = time2%100;
    int sum=0;
    while(year1<year2||month1<month2||day1<day2){
        day1++;
        if(month1==2&&isleap(year1)){
            if(day1==30){
                month1++;
                day1=1;
            }
        }else if(month1 == 2){
            if(day1==29){
                month1++;
                day1=1;
            }
        }
        if(day1 == month[month1]+1){
            month1++;
            day1=1;
        }
        if(month1==13){
            year1++;
            month1 = 1;  
        }
        sum++;
    }
    printf("%d\n",sum);
    return 0;
}
// 模拟的思想:一天一天加到后面的日期，什么时候进位需要处理。
// 注意&&和||的区别:||因为要短路所以条件应该是递进的。